package jobs

type Strategy interface {
	Register(job *JobMessage)
}

type (
	Context struct {
		strategy Strategy
	}
)

func NewContext(topicStrategy Strategy) *Context {
	return &Context{
		strategy: topicStrategy,
	}
}

// Execute 执行当前策略
func (c *Context) Execute(job *JobMessage) {
	c.strategy.Register(job)
}
